package com.itheima.mapper;

import com.itheima.pojo.Dish;
import com.itheima.vo.DishFlavors;
import com.itheima.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 王同学
 */
@Mapper
@Repository //这个是去波浪线的 就是idea识别不到那个东西
public interface DishMapper {

    int add(@Param("dish") Dish dish);


    List<Dish> page(String name, Integer page1, Integer pageSize, Integer type);

    Dish findById(@Param("id") String id);

    boolean delete(@Param("list")List<String> list);

    int update(DishVO dishVO);

    int addFlavors(@Param("dishFlavors") DishFlavors dishFlavors);

    int batchAddFlavors(@Param("list") List<DishFlavors> list);

    int updateById(@Param("dishVO") DishVO dishVO);

    //查询口味的个数 计算总个数
    int countByFlavoreDishId(@Param("countId") String countId);
    //通过id删除原本菜品的口味
    int delByFlavoreDishId(@Param("del") String del);

    int status(@Param("ids") String ids,@Param("sta") int status);

    List<Dish> findAll(@Param("id") String categoryId);

    boolean delByFlavoreDishIds(@Param("list")List<String> list);
}
